package com.atguigu.contacts;

import java.util.Arrays;
public class ArrayUtilsTest {
	public static void main(String[] args) {
		ArrayUtils myUtils = new ArrayUtils();
		int[] arr = new int[]{1,3,2,34,56,1116,111};
		System.out.println(myUtils.getMax(arr));
		System.out.println(myUtils.getMax(12,425,123));
		int aa = 12;
		int bb = 30;
		String str22 = "hello 123";
		String str33 = new String("hello 1234");
		changeValue(aa,bb);
		System.out.println("aa:" + aa);
		System.out.println("bb:" + bb);
		System.out.println("cc:" + myUtils.getMax(25,28));
		System.out.println("cc:" + myUtils.getMax(25,28,11));
		System.out.println("cc:" + myUtils.getMax(new int[]{3,45}));
		System.out.println("getSum:" + getSum(100));
		System.out.println("getSum2:" + getSum2(5));
		System.out.println("str22:" + str22);
		System.out.println("str33:" + str33);
	}
	public static void changeValue (int a,int b) {
		int temp =a;
		a = b;
		b = temp;
		System.out.println("a:" + a);
		System.out.println("b:" + b);
	}
	public static int getSum (int num) {
		if (num == 1) {
			return 1;
		} else {
			return num + getSum(num-1);
		}
	}
	public static int getSum2 (int num) {
		if (num == 1) {
			return 1;
		} else {
			return num * getSum2(num-1);
		}
	}
}
